# celery multi start worker1 -A django_celery_tasks -l info --pidfile=./logs/worker1_%n.pid --logfile=./logs/worker1_%n.log
con=100
poj="django_celery_tasks"
model="eventlet"
if [ $# != 0 ]
then
    if [ $1 == "start" ]
    then
        bash server.sh start
        killall -9 celery
        nohup celery -A $poj worker -l info -O fair -P $model -c $con > ./logs/worker.log 2>&1 &
        # nohup celery -A $poj beat -l info > ./logs/beat.log 2>&1 & # 启动Celery定时任务
        echo "celery服务启动成功..."
    elif [ $1 == 'stop' ]
    then
        bash server.sh stop
        killall -9 celery
        echo "celery服务停止成功..."
    else
        echo "start：开启(or 重启)服务；stop：停止服务；help：帮助信息"
    fi
else
    echo "参数错误，可以尝试命令：bash celery-master.sh help"
fi